import { RouteRecordRaw } from 'vue-router'
export const Layout = () => import('@/layout/index.vue')

const b2bRoutes: RouteRecordRaw[] = [
    {
        path: '/b2b',
        component: Layout,
        redirect: '/b2b/product',
        name: 'B2B',
        meta: { title: 'B2B推广', icon: 'global-line' },
        children: [
            {
                path: 'product',
                name: 'ProductPromotion',
                meta: { title: '产品推广' },
                children: [
                    {
                        path: 'add',
                        component: () => import('@/views/b2bPromotion/product/Add.vue'),
                        name: 'AddProduct',
                        meta: { title: '添加产品' },
                        children: []
                    },
                    {
                        path: 'promotion',
                        component: () => import('@/views/b2bPromotion/product/Promotion.vue'),
                        name: 'PromotionProduct',
                        meta: { title: '推广中产品' },
                        children: []
                    },
                    {
                        path: 'list',
                        component: () => import('@/views/b2bPromotion/product/List.vue'),
                        name: 'ProductList',
                        meta: { title: '产品管理' },
                        children: []
                    },
                    {
                        path: 'detail/:id',
                        component: () => import('@/views/b2bPromotion/product/Detail.vue'),
                        name: 'ProductDetail',
                        meta: { title: '产品详细',hidden:true },
                        children: []
                    },
                    {
                        path: 'edit/:id',
                        component: () => import('@/views/b2bPromotion/product/Edit.vue'),
                        name: 'ProductEdit',
                        meta: { title: '产品修改',hidden:true },
                        children: []
                    }
                ]
            },
            {
                path: 'article',
                name: 'ArticlePromotion',
                meta: { title: '文章推广' },
                children: [
                    {
                        path: 'add',
                        component: () => import('@/views/b2bPromotion/article/Add.vue'),
                        name: 'AddArticle',
                        meta: { title: '添加文章' },
                        children: []
                    },
                    {
                        path: 'promotion',
                        component: () => import('@/views/b2bPromotion/article/Promotion.vue'),
                        name: 'PromotionArticle',
                        meta: { title: '推广中文章' },
                        children: []
                    },
                    {
                        path: 'list',
                        component: () => import('@/views/b2bPromotion/article/List.vue'),
                        name: 'ArticleList',
                        meta: { title: '文章管理' },
                        children: []
                    },
                    {
                        path: 'detail/:id',
                        component: () => import('@/views/b2bPromotion/article/Detail.vue'),
                        name: 'ArticleDetail',
                        meta: { title: '文章详细',hidden:true },
                        children: []
                    },
                    {
                        path: 'edit/:id',
                        component: () => import('@/views/b2bPromotion/article/Edit.vue'),
                        name: 'ArticleEdit',
                        meta: { title: '文章修改',hidden:true },
                        children: []
                    }
                ]
            },
            {
                path: 'effect',
                name: 'PromotionEffect',
                meta: { title: '推广成果' },
                children: [
                    {
                        path: 'data-report',
                        component: () => import('@/views/b2bPromotion/effect/DataReport.vue'),
                        name: 'DataReport',
                        meta: { title: '数据报表',keepAlive:true },
                        children: []
                    },
                    {
                        path: 'ranking-report',
                        component: () => import('@/views/b2bPromotion/effect/RankingReport.vue'),
                        name: 'RankingReport',
                        meta: { title: '排名报表' },
                        children: []
                    }
                ]
            },
            {
                path: 'user',
                name: 'UserCenter',
                meta: { title: '用户中心' },
                children: [
                    {
                        path: 'company-info',
                        component: () => import('@/views/b2bPromotion/user/CompanyInfo.vue'),
                        name: 'CompanyInfo',
                        meta: { title: '公司资料' },
                        children: []
                    },
                    {
                        path: 'service-management',
                        component: () => import('@/views/b2bPromotion/user/ServiceManagement.vue'),
                        name: 'ServiceManagement',
                        meta: { title: '服务管理' },
                        children: []
                    },
                ]
            },
        ]
    }
]

export default b2bRoutes;